<?php
	$id_images = $this->uri->segment(3,0);
//	echo $id_images;
	$this->load->database();
	$query = $this->db->query("select images from images where id_images='$id_images'");
	
	foreach($query->result() as $row):
	$im = imagecreatefromstring($row->images);
	
	if ($im !== "") {
	    header('Content-Type: image/jpeg');
	    imagejpeg($im);
	    imagedestroy($im);
	//    header('Content-Type: image/bmp');
	//    imagebmp($im);
	//    imagebmp($im);
	} else {
	//    echo "<img src='site_url('images/nopicture.jpg')' />";
		echo "error";
	}
	//echo "asjkdalksd";
	
	endforeach;
?>